package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanfeng.business.dto.GdbMerchantTransportAreaDTO;
import com.yuanfeng.business.entity.ShopTransportAreaEntity;
import com.yuanfeng.business.vo.TransportAreaVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName ShopTransportAreaMapper
 * @Description  售卖区域表
 * @Author cyp
 * @Date 2023-05-26 10:12:32
 * @Version 1.0
 **/
@Mapper
public interface ShopTransportAreaMapper extends BaseMapper<ShopTransportAreaEntity> {

     /**
      * 查询当前售卖区域模板下 的城市Id
      * @param transportAreaId
      * @return
      */
     String selectByTransportAreaIds(@Param("transportAreaId")Integer transportAreaId);

    /**
     * 查询商品使用的 售卖区域模板
     * @param commonId
     * @return
     */
    Integer selectTransportAreaId(@Param("commonId")Integer commonId);

    /**
     * 删除售卖区域
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 新增售卖区域
     * @param record
     * @return
     */
    int insertSelective(GdbMerchantTransportAreaDTO record);

    /**
     * 更新售卖区域
     * @param param
     * @return
     */
    int updateByPrimaryKeySelective(@Param("param")GdbMerchantTransportAreaDTO param);

    /**
     * 查询售卖区域详情页
     *
     * @param id
     * @return
     */
    TransportAreaVO selectByTransportAreaId(@Param("id")Integer id);

    List<TransportAreaVO> selectByShopId(@Param("shopId")Integer shopId);

    List<String> selectByIdList( @Param("districtIds")List<Integer> districtIds);
}
